import java.text.SimpleDateFormat;
import java.util.*;

public class Test2 {

    public static void main(String arg[]) {
        Date date = new Date();

        Date dNow = new Date();
        SimpleDateFormat dt = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");

        System.out.println(date.toString());
        System.out.println("Current Date: " + dt.format(dNow));

        // 显示格式化时间
        System.out.printf("%s %tB %<te, %<tY", "Due date: \n", date);

        try {
            System.out.println(new Date() + "\n");
            Thread.sleep(1000 * 3);
            System.out.println(new Date() + "\n");
        } catch (Exception e) {
            System.out.println("Got an exception!");
        }


    }
}
